;(function($) {
$.getEntry2Dom = function(option) {

	var src = option;

	var entry = document.createElement('entry');

	if(src.id){
		var id = document.createElement('id');
			id.appendChild(document.createTextNode(src.id.obj));
		entry.appendChild(id);
	}

	if(src.updated){
		var updated = document.createElement('updated');
			updated.appendChild(document.createTextNode(src.updated.obj));
		entry.appendChild(updated);
	}

	if(src.title){
		var title = document.createElement('title');
			title.appendChild(document.createTextNode(src.title.obj));
		entry.appendChild(title);
	}

	if(src.subtitle){
		var subtitle = document.createElement('subtitle');
			subtitle.appendChild(document.createTextNode(src.subtitle.obj));
		entry.appendChild(subtitle);
	}

	if(src.content){
		var content = document.createElement('content');
			if(src.content.type){
				content.setAttribute("type",src.content.type);
			}
			content.appendChild(document.createTextNode(src.content.text));
		entry.appendChild(content);
	}

	if(src.summary){
		var summary = document.createElement('summary');
			summary.appendChild(document.createTextNode(src.summary.obj));
		entry.appendChild(summary);
	}

	if(src.link){
		for(var i=0;i<src.link.length;i++){
			var link = document.createElement('link');
				if(src.link[i].href){
					link.setAttribute("href",src.link[i].href);
				}
				if(src.link[i].rel){
					link.setAttribute("rel",src.link[i].rel);
				}
				if(src.link[i].type){
					link.setAttribute("type",src.link[i].type);
				}
				if(src.link[i].title){
					link.setAttribute("title",src.link[i].title);
				}
			entry.appendChild(link);
		}
	}

	if(src.category){
		for(var c=0;c<src.category.length;c++){
			var category = document.createElement('category');
				if(src.category[c].term){
					category.setAttribute("term",src.category[c].term);
				}
				if(src.category[c].label){
					category.setAttribute("label",src.category[c].label);
				}
				if(src.category[c].scheme){
					category.setAttribute("scheme",src.category[c].scheme);
				}
			entry.appendChild(category);
		}
	}

	if(src.author){
		for(var h=0;h<src.author.length;h++){
			var author = document.createElement('author');
				if(src.author[h].name){
					author.setAttribute("name",src.author[h].name);
				}
				if(src.author[h].uri){
					author.setAttribute("uri",src.author[h].uri);
				}
				if(src.author[h].email){
					author.setAttribute("email",src.author[h].email);
				}
			entry.appendChild(author);
		}
	}

	if(src.contributor){
		for(var t=0;t<src.contributor.length;t++){
			var contributor = document.createElement('contributor');
				if(src.contributor[t].name){
					contributor.setAttribute("name",src.contributor[t].name);
				}
				if(src.contributor[t].uri){
					contributor.setAttribute("uri",src.contributor[t].uri);
				}
				if(src.contributor[t].email){
					contributor.setAttribute("email",src.contributor[t].email);
				}
			entry.appendChild(contributor);
		}
	}

	return entry;

};
})(jQuery);
